package com.yang.auth.controller;

import com.yang.auth.model.vo.verificationcode.SendVerificationCodeReqVo;
import com.yang.auth.service.IVerificationCodeService;
import com.yang.framework.aop.log.ApiOperationLog;
import com.yang.framework.common.response.R;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/verification/code")
public class VerificationCodeController {

    @Resource
    private IVerificationCodeService verificationCodeService;

    @ApiOperationLog("发送验证码")
    @PostMapping("/send")
    public R send(@RequestBody @Validated SendVerificationCodeReqVo sendVerificationCodeReqVo) {
        verificationCodeService.send(sendVerificationCodeReqVo);
        return R.success();
    }

}
